package com.hs.jhzd.utils.enums;

public enum DayOfWeekEnum {

  MONDAY("一", 0), TUESDAY("二", 1), WEDNESDAY("三", 2), THURSDAY("四", 3), FRIDAY("五",
      4), SATURDAY("六", 5), SUNDAY("日", 6);

  private String name;
  private int value;

  DayOfWeekEnum(String name, int value) {
    this.name = name;
    this.value = value;
  }

  /**
   * 根据name获取value.
   * 
   * @param name name
   * @return value
   */
  public static int getValue(String name) {
    for (DayOfWeekEnum d : DayOfWeekEnum.values()) {
      if (d.getName().equals(name)) {
        return d.value;
      }
    }
    return -1;
  }

  public String getName() {
    return name;
  }

}

